


var CommonUI

(function () {
    var $ = jQuery;
    var $w = $(window);
    var fn = {};
    var bind = {};
    var prop = {};
    	
    
	
	fn.setFullScreen = function (target) {
		$(target).width($w.width()).height($w.height());
	};
	
	fn.init = function () {

		document.addEventListener('deviceready', onDeviceReady, false);
		function onDeviceReady() {
			CommonUI.fn.setFullScreen('.fullsize');		
			
					
			$('.login_submit').click(function(e) {
				e.preventDefault();
			});
			window.location.href = '#login';
			$(document).on("pageshow", "#splash", function() { // When entering pagetwo
				setTimeout(function() {
					window.location.href = '#login'
				}, 0);
			}).on("pageshow", "#main-content", function() { // When entering pagetwo
				setTimeout(function() {

				}, 100);
			});


			navigator.geolocation.getCurrentPosition(
					geoOnSuccess, geoOnError);

			function geoOnSuccess(position) {
				alert(7);
				var longitude = position.coords.longitude;
				var latitude = position.coords.latitude;
				var latLong = new google.maps.LatLng(latitude, longitude);

				var mapOptions = {
					center : latLong,
					zoom : 16,
					mapTypeId : google.maps.MapTypeId.ROADMAP
				};

				var map = new google.maps.Map(document
						.getElementById("geolocation"), mapOptions);
				console.dir(map);
			}

			function geoOnError(error) {
				alert("cod: " + error.code + "\n" + "message: "
						+ error.message + "\n");
			}

		}
	}
	
	
	CommonUI = {
    	prop : prop,
    	fn : fn,
    	bind : bind		
    };

}());